import request from './request'

export interface AssistantProps {
  id: number
  name: string
  description: string
  greeting: string
  iconUrl: string
  slug: string
  secondConfigJson: {
    code: string
    outerInfo: AssistantConfigProps[]
  }
  [key: string]: any
}

export interface AssistantConfigProps {
  code: string
  showName: string
  showType: string
  userSelectType: string
  exclusiveLineFlag?: boolean
  itemInfoList: {
    code: string
    showName: string
    inputTips: string
    inputType: string
    selectValue: string | null
    promptAppendType: string
    [key: string]: any
  }[]
  [key: string]: any
}

export interface AssistantListProps {
  code: string
  name: string
  orderBy: number
  assistantInfos: null | AssistantProps[] | []
  systemMostlyUse: null | AssistantProps[] | []
  userMostlyUse: null | AssistantProps[] | []
}

const getAssistantInfo = (params?: { lang: string }) =>
  request.get<string, AssistantListProps[], Record<string, any>>(
    `/aigc/chat/assistant/v1/infos/instagram`,
    {
      params,
    }
  )
const API = {
  getAssistantInfo,
}
export default API
